#include "head.h"

int socket_handler(int socket_fd, bool *is_connect, int epoll_fd)
{
    char buf[4096] = {0};
    int ret = recv_train(buf, socket_fd);
    if (ret == 0)
    {       
        epoll_del(epoll_fd, socket_fd);
        close(socket_fd);
        *is_connect = 0;
        return 1;
    }
    else
    {
        printf("%s",buf);
        fflush(stdout);
        if (strcmp(buf, "token解析错误!") == 0)
        {
            exit(0);
        }
        return 0;
    }
}
